<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('订单编号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-order_no" class="form-control" name="row[order_no]" type="text" value="{$row.order_no}" readonly>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-6 col-sm-2">{:__('店铺名称')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="shop_name" class="form-control" value="{$row.shop_name}" readonly>
        </div>
        <label class="control-label col-xs-6 col-sm-2">{:__('包厢名称')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="room_name" class="form-control" value="{$row.room_name}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-6 col-sm-2">{:__('下单用户')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="user_id" class="form-control" name="row[user_id]" value="{$row.user_id}" readonly>
        </div>
        <label class="control-label col-xs-6 col-sm-2">{:__('订单金额')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="amount" class="form-control" value="{$row.amount}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-6 col-sm-2">{:__('团购券')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="tuan" class="form-control" name="row[tuan_id]" value="{$row.tuan_id}" readonly>
        </div>
        <label class="control-label col-xs-6 col-sm-2">{:__('美团编号')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="meituan" class="form-control" name="row[mt_code]" value="{$row.mt_code}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-6 col-sm-2">{:__('抖音编号')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="dou" class="form-control" name="row[dou_code]" value="{$row.dou_code}" readonly>
        </div>
        <label class="control-label col-xs-6 col-sm-2">{:__('优惠券')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="coupon" class="form-control" name="row[coupon_id]" value="{$row.coupon_id}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-6 col-sm-2">{:__('订单状态')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="status" class="form-control" value="{$row.status}" readonly>
        </div>
        <label class="control-label col-xs-6 col-sm-2">{:__('已退实付')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="refund_amounted" name="row[refund_amounted]" class="form-control" value="{$row.refund_amount}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-6 col-sm-2">{:__('支付的余额')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="balance" name="row[balance]" class="form-control" value="{$row.balance}" readonly>
        </div>
        <label class="control-label col-xs-6 col-sm-2">{:__('余额退款')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="refund_balance" name="row[refund_balance]" class="form-control" value="{$row.balance}" type="number" readonly>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-6 col-sm-2">{:__('实付金额')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="pay_amount" name="row[pay_amount]" class="form-control" value="{$row.pay_amount}" readonly>
        </div>
        <label class="control-label col-xs-6 col-sm-2">{:__('实付退款')}:</label>
        <div class="col-xs-6 col-sm-3">
            <input id="refund_amount" class="form-control" name="row[refund_amount]" type="number" step="0.01" value="{$row.pay_amount}">
        </div>
    </div>



    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script>
    // 获取input元素
    var inputElement = document.getElementById('status');

    // 获取input的值
    var inputValue = inputElement.value;
    if(inputValue === 'payed'){
        inputElement.value = "待消费";
    }else if(inputValue === 'doing'){
        inputElement.value = "消费中";
    }else if(inputValue === 'done'){
        inputElement.value = "已完成";
    }else if(inputValue === 'refund'){
        inputElement.value = "已退款";
    }else{
        inputElement.value = "其他";
    }

</script>
